﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.IO;

namespace ServerTest{
    [XmlRoot("UsersCollection")]
    public class UsersContainer{
        [XmlArray("Users"), XmlArrayItem("User")]
        
        public List<User> Users = new List<User>();

        public static UsersContainer Load(string path){
            var serializer = new XmlSerializer(typeof(UsersContainer));
            using (var stream = new FileStream(path, FileMode.Open)){
                return serializer.Deserialize(stream) as UsersContainer;
            }
        }
    }
}
